package com.kingcat.smartchair.utils;

import android.content.Context;
import android.webkit.WebView;

import com.kingcat.smartchair.webview.SmartChairWebView;

public class AppUtils {
    // 当前ACTIVITY上下文
    private static Context mAppContext;

    // 当前URL
    private static String currUrl = null;

    // 当前是否处于解锁状态
    private static boolean isUnlock = false;

    // 当前WEBVIEW对象
    private static SmartChairWebView mWebview = null;

    // 要下载的API大小
    private static long apkSize = 0;

    // 已下载的APK大小
    private static long apkDownloadSize = 0;

    /*
     * 当前ACTIVITY上下文
     * */
    public static void init(Context appContext) {
        mAppContext = appContext;
    }

    public static Context getAppContext() {
        return mAppContext;
    }


    /*
     * 当前WEBVIEW对象
     * */
    public static void setAppWebView(SmartChairWebView _webview) {
        mWebview = _webview;
    }
    public static SmartChairWebView getAppWebView() {
        return mWebview;
    }


    /*
     * 当前URL
     * */
    public static void setAppWebViewCurrUrl(String _url) {
        currUrl = _url;
    }
    public static String getAppWebViewCurrUrl() {
        return currUrl;
    }

    /*
     * 当前是否处于APP使用锁定状态
     * */
    public static void setAppIsUnlock(boolean _isUnlock) {
        isUnlock = _isUnlock;
    }
    public static boolean getAppIsUnlock() {
        return isUnlock;
    }

    /*
     * 要下载的API大小
     * */
    public static void setApkSize(long _apkSize) {
        apkSize = _apkSize;
    }
    public static long getApkSize() {
        return apkSize;
    }

    /*
     * 已下载的APK大小
     * */
    public static void setApkDownloadSize(long _apkDownloadSize) {
        apkDownloadSize = _apkDownloadSize;
    }
    public static long getApkDownloadSize() {
        return apkDownloadSize;
    }
}
